<template>
  <aside class="btn-box">
    <el-row type="flex" :gutter="15">
      <el-col :span="2">
        <el-button type="primary" size="mini" icon="el-icon-circle-plus-outline" @click="showAddForm">新增</el-button>
        <warehouse-info-dialog ref="warehouseInfoForm" />
      </el-col>
      <el-col :span="2">
        <el-button type="primary" icon="el-icon-download" size="mini" @click="downloadFun">导出</el-button>
      </el-col>
      <el-col :span="2">
        <el-button type="primary" icon="el-icon-search" size="mini" @click="showSearchForm">检索</el-button>
        <warehouse-info-search ref="search" @searchContent="searchFun" />
      </el-col>
    </el-row>
  </aside>
</template>

<script>
import warehouseInfoDialog from './warehouse-info-dialog'
import warehouseInfoSearch from './warehouse-info-search'
export default {
  components: { warehouseInfoDialog, warehouseInfoSearch },
  data() {
    return {
      form: {
        name: ''
      },
      dialogFormVisible: false,
      formLabelWidth: '80px',
      dialogAddNew: false
    }
  },
  methods: {
    addFun() {
    //   this.$emit('handleAdd')
      console.log('新增')
    },
    showAddForm() {
      this.$refs.warehouseInfoForm.dialogAddNew = true
    },
    showSearchForm() {
      console.log('search')
      this.$refs.search.dialogFormSearch = true
    },
    downloadFun() {
      this.$emit('downloadFun')
    },
    searchFun(val) {
      console.log(val)
    }
  }
}
</script>

<style lang="scss" scoped>
  .btn-box {
      width: 100%;
      padding:10px;
      box-sizing: border-box;
      border-radius: 5px;
  }
</style>
